package com.test.spring.transaction.xml.service.impl;

import com.test.spring.transaction.xml.service.BookShopService;
import com.test.spring.transaction.xml.service.Cashier;

import java.util.List;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/29 10:49
 */
public class CashierImpl implements Cashier {

    private BookShopService bookShopService;

    public void setBookShopService(BookShopService bookShopService) {
        this.bookShopService = bookShopService;
    }

    @Override
    public void checkout(String username, List<String> isbns) {
        isbns.forEach(isbn -> {
            bookShopService.purchase(username, isbn);
        });
    }
}
